
const {ccclass, property} = cc._decorator;

@ccclass
export default class baseItemScript extends cc.Component {

    /**
     * 快速获取某个节点或其组件
     * @param str 节点名称
     * @param com 组件
     */
    _get_(str:string,){
        if(this.node.name==str){
            return this.node;
        }
        var n=this.getNodeChild(str,this.node)
        return n;
    }
    getNodeChild(str:string,node:cc.Node){
        for(let i in node.children){
            if(node.children[i].name==str){
                return node.children[i];
            }else{
                this.getNodeChild(str,node.children[i])
            }
        }
    }
}
